#pragma once
#include <Ice\Ice.h>

namespace Xts
{
	namespace IceRuntime
	{
		class XIceApp : public IceUtil::Shared
		{
		public:
			XIceApp(const std::string& configPath = "");
			virtual ~XIceApp(void);
			
			bool InitObjectAdapter(const std::string& adapterName, const std::string& endPnt = "");

			Ice::CommunicatorPtr RetrieveCommunicator();
			Ice::LoggerPtr RetrieveLogger(const std::string& prefix = "");
			std::vector<std::string> RetrieveAdapterNames()const;
			Ice::ObjectAdapterPtr RetrieveObjectAdapter(const std::string& adapterName);
			

		protected:
			Ice::CommunicatorPtr x_pIc;
			Ice::LoggerPtr x_pLogger;
			std::map<std::string, Ice::ObjectAdapterPtr> x_objectAdapterSet;						
		};
		typedef IceUtil::Handle<XIceApp> XIceAppPtr;

	}
}


